﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="AdminDelivery.aspx.cs" Inherits="AdminDelivery" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        .style1
        {
            font-size: xx-large;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <strong><span class="style1">Delivery Page:</span></strong><br />
    
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
            AllowSorting="True" AutoGenerateColumns="False" BackColor="White" 
            BorderColor="#3366CC" BorderStyle="None" BorderWidth="1px" CellPadding="4" 
            DataKeyNames="UserID" DataSourceID="SqlDataSource1">
            <Columns>
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" 
                    ShowSelectButton="True" />
                <asp:BoundField DataField="UserID" HeaderText="UserID" InsertVisible="False" 
                    ReadOnly="True" SortExpression="UserID" />
                <asp:BoundField DataField="CustomerName" HeaderText="CustomerName" 
                    SortExpression="CustomerName" />
                <asp:BoundField DataField="AmountPaid" HeaderText="AmountPaid" 
                    SortExpression="AmountPaid" />
                <asp:BoundField DataField="DeliveryAddress" HeaderText="DeliveryAddress" 
                    SortExpression="DeliveryAddress" />
                <asp:BoundField DataField="DateDelivery" HeaderText="DateDelivery" 
                    SortExpression="DateDelivery" />
                <asp:BoundField DataField="DeliverTime" HeaderText="DeliverTime" 
                    SortExpression="DeliverTime" />
            </Columns>
            <FooterStyle BackColor="#99CCCC" ForeColor="#003399" />
            <HeaderStyle BackColor="#003399" Font-Bold="True" ForeColor="#CCCCFF" />
            <PagerStyle BackColor="#99CCCC" ForeColor="#003399" HorizontalAlign="Left" />
            <RowStyle BackColor="White" ForeColor="#003399" />
            <SelectedRowStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
            <SortedAscendingCellStyle BackColor="#EDF6F6" />
            <SortedAscendingHeaderStyle BackColor="#0D4AC4" />
            <SortedDescendingCellStyle BackColor="#D6DFDF" />
            <SortedDescendingHeaderStyle BackColor="#002876" />
        </asp:GridView>
        <br />
        <asp:Button ID="Button1" runat="server" onclick="Button1_Click" 
            Text="RegistrationPage" Width="134px" />
&nbsp;&nbsp;&nbsp;
        <br />
        <br />
        <br />
        <br />
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:RegConnectionString %>" 
            DeleteCommand="DELETE FROM [DateDelivery] WHERE [UserID] = @UserID" 
            InsertCommand="INSERT INTO [DateDelivery] ([CustomerName], [AmountPaid], [DeliveryAddress], [DateDelivery], [DeliverTime]) VALUES (@CustomerName, @AmountPaid, @DeliveryAddress, @DateDelivery, @DeliverTime)" 
            SelectCommand="SELECT * FROM [DateDelivery]" 
            
            UpdateCommand="UPDATE [DateDelivery] SET [CustomerName] = @CustomerName, [AmountPaid] = @AmountPaid, [DeliveryAddress] = @DeliveryAddress, [DateDelivery] = @DateDelivery, [DeliverTime] = @DeliverTime WHERE [UserID] = @UserID">
            <DeleteParameters>
                <asp:Parameter Name="UserID" Type="Int32" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="CustomerName" Type="String" />
                <asp:Parameter Name="AmountPaid" Type="String" />
                <asp:Parameter Name="DeliveryAddress" Type="String" />
                <asp:Parameter Name="DateDelivery" Type="String" />
                <asp:Parameter Name="DeliverTime" Type="String" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="CustomerName" Type="String" />
                <asp:Parameter Name="AmountPaid" Type="String" />
                <asp:Parameter Name="DeliveryAddress" Type="String" />
                <asp:Parameter Name="DateDelivery" Type="String" />
                <asp:Parameter Name="DeliverTime" Type="String" />
                <asp:Parameter Name="UserID" Type="Int32" />
            </UpdateParameters>
        </asp:SqlDataSource>
    
    </div>
    </form>
</body>
</html>
